from core.decorators.open_api import open_api
from views.model import Customer


class Test:
    @open_api(name="say.hello")
    def say_hello(self):
        # 可以查询数据能操作
        # Customer.batch_add([{"name":"小明","age":18,"sex":"male"}])
        names = Customer.get_customers_by_sex("male")
        result = ""
        for _name in names:
            result += f",{_name[0]}"
        return result
